package com.factory.pattern.service.impl;

import com.factory.pattern.service.AbstractFactory;
import com.factory.pattern.service.Color;
import com.factory.pattern.service.Shape;

/**
 * @author chenchen
 * @description
 * @date 2023/11/17 11:36
 */
public class ShapeFactory extends AbstractFactory {
    @Override
    public Shape getShape(String shape) {
        if(shape.equalsIgnoreCase("CIRCLE")){
            return new Circle();
        } else if(shape.equalsIgnoreCase("RECTANGLE")){
            return new Rectangle();
        } else if(shape.equalsIgnoreCase("SQUARE")){
            return new Square();
        }
        return null;
    }
}
